package com.eascs.admin.o2o.internal.util;

import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;

@Component
public class BaseUtils {
	public  static final String Y_DEL_FLAG="1";
	public  static final String N_DEL_FLAG="0";
	public  static final int PAGE_INDEX=0;
	public  static final int PAGE_SIZE=10;
	public  static final int DB_ROWCOUNTDB=10;
	@Value("${o2o.admin.approvalUrl}")
	private  String approvalUrl;
	@Value("${o2o.admin.agreeUrl}")
	private String agreeUrl;
	//输出工作流地址
	public   String getApprovalUrl(String nodeAuditorId,String systemModule){
		StringBuffer url = new StringBuffer();
		url.append(approvalUrl);
		if(StringUtils.isNotEmpty(nodeAuditorId)){
			url.append("&nodeAuditorId=").append(nodeAuditorId);
		}
		if(StringUtils.isNotEmpty(systemModule)){
			url.append("&systemModule=").append(systemModule);
		}
		return url.toString();
	}
	public  String getApprovalAgreeUrl(String loanapplyNo,String nodeAuditorId, String systemModule){
		StringBuffer url = new StringBuffer();
		url.append(agreeUrl);
		if(StringUtils.isNotEmpty(loanapplyNo)){
			url.append("&referId=").append(loanapplyNo);
		}
		if(StringUtils.isNotEmpty(nodeAuditorId)){
			url.append("&nodeAuditorId=").append(nodeAuditorId);
		}
		if(StringUtils.isNotEmpty(systemModule)){
			url.append("&systemModule=").append(systemModule);
		}
		return url.toString();
	}
}
